// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "OSSInfo.h"

namespace AlibabaCloud
{
	namespace OSS
	{
		class ServiceRequest;
		class OssClient;
	}
}


class ALIYUNCPPPLUGIN_API FOssClient
{
public:

	//Cannot repeat link
	static bool LinkClient(const FOssOssClientInfo& ClientInfo);

	static FOssClient& Get();

	static AlibabaCloud::OSS::OssClient& GetClientRef();

	bool IsLink()const;

private:

	FOssOssClientInfo info;
	AlibabaCloud::OSS::OssClient* ossClient;


	bool LinkOssClient(const FOssOssClientInfo& linkInfo);



	FOssClient();
	~FOssClient();
	FOssClient(FOssClient&) = delete;
	FOssClient& operator=(const FOssClient&) = delete;


	friend class FAliyunCppPluginModule;

	static void InitializeSdk();
	static void ShutdownSdk();
};


class ALIYUNCPPPLUGIN_API FOssHashOper
{
public:

	static FString GetLocalFileHashString(const FString& InFilename);

	static FString GetFileHashString(const TArray<uint8>& arrByte);

	static FString GetCloudFileHashString(const FString& InFilename);

	static FString GetCloudFileHashString(const FString& bucketName, const FString& objectKey);
};